import time

from selenium import webdriver
from selenium.webdriver.common.by import By
#打开浏览器
driver = webdriver.Chrome()
#进入ecshopPC演示站
driver.get('https://ecshop.test2.shopex123.com/')
driver.maximize_window()
#定位搜索框
time.sleep(1)
keyword = driver.find_element(By.ID,'keyword')
#在搜索框输入内容
time.sleep(1)
keyword.send_keys('资生堂')
#定位并点击搜索按钮
driver.find_element(By.XPATH,'//*[@id="searchForm"]/table/tbody/tr/td[2]/input').click()
#关闭浏览器
time.sleep(10)
driver.quit()